#!/bin/bash

upper ()
{
    echo $@ | tr '[:lower:]' '[:upper:]'
}

CLASS_NAME=""
FILE_NAME=""

echo -n "File name: "
read FILE_NAME

echo -n "Class name: "
read CLASS_NAME

GUARDS="__`upper $CLASS_NAME`__"

echo \
"#ifndef $GUARDS
#define $GUARDS

class $CLASS_NAME
{
public:
    $CLASS_NAME();
    virtual ~$CLASS_NAME();
};

#endif" > "$FILE_NAME.hpp"

echo \
"#include \"$FILE_NAME.hpp\"

$CLASS_NAME::$CLASS_NAME()
{

}

$CLASS_NAME::~$CLASS_NAME()
{

}" > "$FILE_NAME.cpp"
